﻿<%@page import="com.dao.impl.SubstanceDaoImpl"%>
<%@page import="com.dao.impl.ColumnDaoImpl"%>
<%@page import="com.po.Column"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<link href="${pageContext.request.contextPath }/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="${pageContext.request.contextPath }/css/style.css" rel="stylesheet" type="text/css" media="all" />	
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Sport Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!--//fonts-->

</head>
<%
	pageContext.setAttribute("page", new ColumnDaoImpl().findAll());
	pageContext.setAttribute("pageresult", new SubstanceDaoImpl().findByStype("head"));
 %>
<body> 
<!--header-->
	<div class="line">
	
	</div>
	<div class="header">
		<div class="logo">
			<a href="index.html"><img src="${pageContext.request.contextPath }/images/logo.png" alt="" ></a>
		</div>
		<div  class="header-top">
			<div class="header-grid">
				<ul class="header-in">
					<c:choose>
						<c:when test="${empty sessionScope.Manager }">
							<li ><a href="${pageContext.request.contextPath }/loginmanager.jsp"> 登录 </a> </li>		
							<li ><a href="${pageContext.request.contextPath }/register_ordinary.jsp"> 注册 </a> </li>
						</c:when>
						<c:when test="${!empty sessionScope.Manager }">
							<li><a>欢迎${sessionScope.Manager.uname }</a></li>
							<li ><a href="${pageContext.request.contextPath }/ordinary/ShutDownServlet.do"> 注销 </a> </li>
						</c:when>
					</c:choose>
				</ul>
					<div class="search-box">
					    <div id="sb-search" class="sb-search">
							<form>
								<input class="sb-search-input" placeholder="Enter your search term..." type="search" name="search" id="search">
								<input class="sb-search-submit" type="submit" value="">
								<span class="sb-icon-search"> </span>
							</form>
						</div>
				    </div>
					<!-- search-scripts -->
					<script src="${pageContext.request.contextPath }/js/classie.js"></script>
					<script src="${pageContext.request.contextPath }/js/uisearch.js"></script>
						<script>
							new UISearch( document.getElementById( 'sb-search' ) );
						</script>
					<!-- //search-scripts -->
					<div class="online">
					<a href="single.html" >SHOP ONLINE</a>
					</div>
					<div class="clearfix"> </div>
			</div>
			<div class="header-bottom">
				<div class="h_menu4"><!-- start h_menu4 -->
				<a class="toggleMenu" href="#">Menu</a>
				<ul class="nav">
				<li class="active"><a href="${pageContext.request.contextPath }/ordinary/ShowIndexContextServlet.do?ptype=other&stype=hot">热点</a></li>
				<li class="active"><a href="${pageContext.request.contextPath }/ordinary/ShowIndexContextServlet.do?ptype=other&stype=recommand">推荐</a></li>
				<li class="active"><a href="${pageContext.request.contextPath }/ordinary/ShowIndexContextServlet.do?ptype=other&stype=head">头条</a></li>
				<c:forEach items="${page }" var="p">
					<li class="active"><a href="${pageContext.request.contextPath }/ordinary/ShowIndexContextServlet.do?ptype=lanmu&scid=${p.cid}">${p.cname }</a></li>
				</c:forEach>	
				</ul>
				<script type="text/javascript" src="js/nav.js"></script>
			</div><!-- end h_menu4 -->
			<div class="clearfix"> </div>
		</div>
		</div>
		<div class="clearfix"> </div>
	</div>
	<!---->
	<c:forEach items="${pageresult }" var="q">
	<c:if test="${q.sup == 1 }">
	<div class="panel panel-default" style="text-align: center;">
			<div class="panel-heading">
				<h3 class="panel-title">${q.sauthor }</h3>
			</div>
			<div class="panel-body"><a href="${pageContext.request.contextPath }/ordinary/ShowIndexContextServletTwo.do?sid=${q.sid}">${q.stitle }</a></div>
		</div>
		</c:if>
	</c:forEach>
</body>
</html>